package net.cyl.listener;


import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import net.cyl.emums.BizCodeEnum;
import net.cyl.exception.BizException;
import net.cyl.model.EventMessage;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;


@Component
//@RabbitListener(queues ="short.link.add.link.queue")
@RabbitListener(queuesToDeclare = {@Queue("short_link.error.queue")})
@Slf4j
public class ShortLinkErrorMQListener {
    @RabbitHandler
    public void shortLinkHandle(EventMessage eventMessage, Message message, Channel channel) throws IOException {
         log.error("接收到消息：{}",eventMessage);
         log.error("告警处理：{}",eventMessage);
         log.error("告警成功，发送通知短信");

    }
}
